package main;

public class Book {
    private String name;
    private String author;
    private int year;

    public Book(String name, String author, int year, int quantity) {
        this.name = name;
        this.author = author;
        this.year = year;
    }

    public String getName() {
        return name;
    }

    @Override
    public boolean equals(Object object) {
        if (object instanceof Book) {
            Book book = (Book) object;
            return name.equals(book.name) && author.equals(book.author) && this.year == book.year;
        } else
            return false;
    }

    @Override
    public String toString() {
        return String.format("%s %s %s", name, author, year);
    }
}
